-- background: 6849 from stack: in -- bmap block id: 3714 -- flags: 4000 -- background id: 0 -- name: ----- HyperTalk script ----- on openCard if field "ID" is empty then get location of field "ID" click at it end if if background field "Special Case" is empty then set hilite of background button "Special Case" to false else set hilite of background button "Special Case" to true end if end openCard -- part 1 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=29 top=63 right=82 bottom=157 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ID -- part 2 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=45 top=95 right=145 bottom=505 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Title -- part 3 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=68 top=159 right=193 bottom=505 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Authors -- part 4 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=63 top=211 right=230 bottom=309 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Journal -- part 5 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=158 top=247 right=265 bottom=208 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Volume -- part 6 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=370 top=247 right=265 bottom=420 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Number -- part 7 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=158 top=279 right=297 bottom=208 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Beginning Page -- part 8 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=370 top=279 right=297 bottom=420 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Ending Page -- part 9 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=158 top=311 right=329 bottom=208 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Year -- part 12 (button) -- low flags: 00 -- high flags: A002 -- rect: left=165 top=26 right=47 bottom=237 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Abstracts ----- HyperTalk script ----- on mouseUp set the lockScreen to true put field "ID" into temp go to first card of "Abstracts" if temp is empty then exit mouseUp find temp in field "ID" if the result is empty then exit mouseUp end if go to last card of "Abstracts" doMenu "New Card" put temp into field "ID" end mouseUp -- part 13 (button) -- low flags: 00 -- high flags: A002 -- rect: left=240 top=26 right=47 bottom=316 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Key Words ----- HyperTalk script ----- on mouseUp set the lockScreen to true put field "ID" into temp go to first card of "Key Words" if temp is empty then exit mouseUp find temp in field "ID" if the result is empty then exit mouseUp end if go to last card of "Key Words" doMenu "New Card" put temp into field "ID" end mouseUp -- part 16 (button) -- low flags: 00 -- high flags: A002 -- rect: left=319 top=26 right=47 bottom=357 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Sort ----- HyperTalk script ----- on mouseUp sort by field "ID" end mouseUp -- part 18 (button) -- low flags: 00 -- high flags: A002 -- rect: left=360 top=26 right=47 bottom=421 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Options ----- HyperTalk script ----- on mouseUp go to card "Options" of "Reference Frame" end mouseUp -- part 20 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=456 top=10 right=63 bottom=490 -- title width / last selected line: 0 -- icon id / first selected line: 1014 / 1014 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Prev ----- HyperTalk script ----- on mouseUp go prev card of this background end mouseUp -- part 21 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=478 top=10 right=63 bottom=512 -- title width / last selected line: 0 -- icon id / first selected line: 1013 / 1013 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next ----- HyperTalk script ----- on mouseUp go next card of this background end mouseUp -- part 25 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=425 top=19 right=55 bottom=464 -- title width / last selected line: 0 -- icon id / first selected line: 21060 / 21060 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Help ----- HyperTalk script ----- on mouseUp global expert set the lockScreen to true push card go to card "Papers-Help" of "Reference Frame" if expert is not true then show card field "Papers-Help" end mouseUp -- part 28 (button) -- low flags: 80 -- high flags: A003 -- rect: left=170 top=60 right=79 bottom=229 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Export ----- HyperTalk script ----- on mouseUp global exportFile, exportNumber set the cursor to 4 put output(exportNumber) into it put exportNumber + 1 into exportNumber end mouseUp -- -- output() writes this current record to file exportFile -- function output number global prefix, wrtNumbers, numberAffix, howMany, order, affix , nBlankL, exportFile put prefix into string if wrtNumbers is true then put string & number & numberAffix into string end if -- -- check to see if this is a special case -- if background field "Special Case" is not empty then put string & background field "Special Case" into string else -- build a normal reference -- repeat with i = 1 to howMany if item i of order is "authors" then put string & buildAuthors(field "authors") & line i of affix into string else put string & field item i of order & line i of affix into string end if end repeat end if write wrap(string) to file exportFile repeat with i = 1 to nBlankL + 1 write return to file exportFile end repeat end output -- -- buildAuthors() builds author list in correct format -- function buildAuthors authors global authorOrder, authorsAffix put authorOrder into order put authorsAffix into affix put number of items in authors into numAuthors put item 1 of authors into name put firstName(name) into firstN if char 1 of firstN is " " then delete char 1 of firstN put lastName(name) into lastN if char 1 of order is "f" then put firstN & line 1 of affix & lastN into outStr else put lastN & line 1 of affix & firstN into outStr end if delete char 1 to 2 of order delete line 1 of affix repeat with n = 2 to numAuthors - 1 put outStr & line 1 of affix into outStr put item n of authors into name put firstName(name) into firstN if char 1 of firstN is " " then delete char 1 of firstN put lastName(name) into lastN if char 1 of order is "f" then put outStr & firstN & line 2 of affix & lastN into outStr else put outStr & lastN & line 2 of affix & firstN into outStr end if end repeat if numAuthors < 2 then return outStr delete char 1 to 2 of order delete line 1 to 2 of affix put outStr & line 1 of affix into outStr put item numAuthors of authors into name put firstName(name) into firstN if char 1 of firstN is " " then delete char 1 of firstN put lastName(name) into lastN if char 1 of order is "f" then put outStr & firstN & line 2 of affix & lastN into outStr else put outStr & lastN & line 2 of affix & firstN into outStr end if return outStr end buildAuthors -- -- firstName() returns first name from string name -- function firstName name put offset(last word of name,name) - 1 into numOfChars if char numOfChars of name is " " then put numOfChars - 1 into numOfChars end if return char 1 to numOfChars of name end firstName -- -- lastName() returns last name from string name -- function lastName name put last word of name into temp if char 1 of temp is quote then delete char 1 of temp repeat with i = 1 to number of chars in temp if char i of temp is quote then delete char i of temp end repeat end if return temp end lastName -- -- wrap() breaks string into lines of at most 80 characters -- function wrap string put number of chars in string into nChars put "80" into start put "1" into stop repeat if start > nChars then exit repeat put start into i repeat while i > stop if char i of string is space then put return into char i of string put i + 1 into stop put 79 + stop into start exit repeat end if put i - 1 into i end repeat if i is stop then repeat with i = start to nChars if char i of string is space then put return into char i of string put i + 1 into stop put 79 + stop into start exit repeat end if end repeat end if end repeat return string end wrap -- part 32 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=318 top=208 right=230 bottom=415 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Special Case ----- HyperTalk script ----- on mouseUp show background button "Finished Special Case" show background field "Special Case" end mouseUp -- part 30 (field) -- low flags: 80 -- high flags: 4001 -- rect: left=1 top=94 right=329 bottom=505 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Special Case -- part 31 (button) -- low flags: 80 -- high flags: A003 -- rect: left=3 top=62 right=86 bottom=161 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Finished Special Case ----- HyperTalk script ----- on mouseUp hide background button "Finished Special Case" hide background field "Special Case" if background field "Special Case" is not empty then set hilite of background button "Special Case" to true else set hilite of background button "Special Case" to false end if end mouseUp